package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class IndexController {


    @GetMapping(value = {"/", "/index"})
    public String index() {
        return "index";
    }

    @GetMapping("/level2/test")
    public String test() {
        return "/level2/test";
    }

    @GetMapping("/level1/button")
    public String button() {
        return "/level1/button";
    }

    @GetMapping("/level3/try")
    public String try1() {
        return "/level3/try";
    }

    @GetMapping(value = {"/toLogin", "/login"})
    public String toLogin() {
        return "login";
    }

    @RequestMapping(value = "/dologin", method = RequestMethod.POST)
    public String doLogin(@RequestParam("username") String username, @RequestParam("password") String password) {
        System.out.println("11111111111");
        return "index";
    }


}
